import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.scss';
import App from './App';
// 引入主题定义组件
import { ConfigProvider } from 'antd';

//引入loadsh并使用
// import _ from 'lodash'
// 深浅拷贝
// var objects = [{ 'a': 1 }, { 'b': 2 }];
// // var shallow = _.clone(objects); // 浅拷贝
// var shallow = _.cloneDeep(objects); // 深拷贝
// shallow[0].a = 100
// console.log('原对象', objects);
// console.log('克隆后', shallow);

// 引入路由模式包
import { BrowserRouter as Router } from 'react-router-dom'

// 引入仓库
// import store from '@/store'
//+++
import { store, persistor } from '@/store/index'
// ++++
import { PersistGate } from "redux-persist/integration/react"
import { Provider } from 'react-redux'
// 引入antd 中文语言包
import zhCN from 'antd/locale/zh_CN';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <ConfigProvider
    theme={{
      token: {
        colorPrimary: '#00b96b',
      },
    }}
    locale={zhCN}
  >
    <Provider store={store}>
      <PersistGate loading={null} persistor={persistor}>
        <Router>
          <App />
        </Router>
      </PersistGate>
    </Provider>

  </ConfigProvider>
);

